package edu.sctu.zhoudie.mouth201506.day20150614.teacher;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

/**
 * Created by user08 on 2015/6/14.
 */
public class Terato {
    public void iter(){
        ArrayList<String> list = new ArrayList<String>();
        list.add("aa");
        list.add("bb");
        list.add("cc");
        for (Iterator iterator = list.iterator();iterator.hasNext();){
            String string = (String)iterator.next();
            System.out.println(string);
        }
        Iterator iterator = list.iterator();
        while (iterator.hasNext()){
            String string = (String)iterator.next();
            System.out.println(string);
        }

        HashMap<String, String> hs=new HashMap();
        hs.put("p1", "1");
        hs.put("p2", "1");
        hs.put("p3", "1");
        hs.put("p4", "1");
        hs.put("p5", "1");
        hs.put("p6", "1");
        Iterator it=hs.keySet().iterator();
        while(it.hasNext())
        {
            String str=(String)it.next();
            System.out.println(hs);
            it.remove();
        }

        //逻辑处理.........

    }
}
